import { FC } from "react";
import { View } from "@tarojs/components";
import styles from "./index.module.less";
import SwiperBanner from "./component/swiper-banner";
import MemberOverView from "./component/member-overview";
import MemberInfo from "./component/member-info";
import MemberLabel from "./component/member-label";
import MemberAsset from "./component/member-asset";
import MemberRequire from "./component/member-require";
import BottomBar from "./component/bottom-bar";
import SiliderBar from "./component/slider-bar";
import useData from "./useData";

const CustomerDetail: FC = () => {
  const {
    customerInfo,
    starFlag,
    userInfo,
    isPermissionContact,
    onStar,
    onArchery,
    onConnect,
  } = useData();
  return (
    <View className={styles["member-wrapper"]}>
      {customerInfo && (
        <>
          <SwiperBanner customerInfo={customerInfo} />
          <MemberOverView
            customerInfo={customerInfo}
            starFlag={starFlag}
            onStar={onStar}
          />
          <MemberInfo customerInfo={customerInfo} />
          <MemberLabel customerInfo={customerInfo} />
          <MemberAsset customerInfo={customerInfo} userInfo={userInfo} />
          <MemberRequire customerInfo={customerInfo} userInfo={userInfo} />
          {/* <BottomBar customerInfo={customerInfo} /> */}
          <SiliderBar
            isPermissionContact={isPermissionContact}
            onArchery={onArchery}
            onConnect={onConnect}
          />
        </>
      )}
    </View>
  );
};

export default CustomerDetail;
